package top.greatxiaozou.singleton;

public class SingletonDefault {
    //构造函数私有化，保证类无法从外部创建
    private SingletonDefault() {
    }

    //实例化唯一类
    private static SingletonDefault instance = new SingletonDefault();

    //返回唯一类
    public static SingletonDefault getInstance() {
        return instance;
    }

    //获取信息
    public void getMessage() {
        System.out.println("hello world");
    }
}
